package com.tbs.easyhomemoneyserver.service

import com.tbs.easyhomemoneyserver.DO.SysUser
import com.tbs.easyhomemoneyserver.exception.WarnException
import com.tbs.easyhomemoneyserver.form.BaseUserSearchForm
import com.tbs.easyhomemoneyserver.form.LoginForm
import com.tbs.easyhomemoneyserver.form.UserCreateForm
import com.tbs.easyhomemoneyserver.model.dto.LoginInfoDTO

interface IUserService {
    /**
     * 创建用户信息
     *
     * @param createForm
     * @return
     * @throws WarnException
     */
    @Throws(Exception::class)
    fun newUser(createForm: UserCreateForm): SysUser

    /**
     * 根据id获取用户信息
     *
     * @param id
     * @return
     * @throws WarnException
     */
    @Throws(Exception::class)
    fun getUserById(id: Long): SysUser?


    /**
     * 根据简单查询表单查询用户信息
     * @param form
     * @return
     */
    fun findUserByCondition(form: BaseUserSearchForm): List<SysUser>

    /**
     * 登录
     *
     * @param loginForm
     * @return
     */
    fun login(loginForm: LoginForm): LoginInfoDTO?

    /**
     * 登出
     *
     * @param loginId
     */
    fun logout(loginId: Long)
}
